//获取系统信息
let systemInfo = uni.getSystemInfoSync();

//获取手机状态栏高度
export function getStatusBarHeight() {
    return systemInfo.statusBarHeight || 10;
};
//获取小程序胶囊按钮距离顶部高度
export function getMenuButtonBoundingClientRectMarginTop() {
    //获取小程序胶囊按钮布局
    if (uni.getMenuButtonBoundingClientRect) {
        let menuButtonBoundingClientRect = uni.getMenuButtonBoundingClientRect();
        return menuButtonBoundingClientRect.top;
    } else {
        return 20;
    }
};
//获取小程序胶囊按钮距离手机状态栏高度
export function getMenuButtonBoundingClientRectMarginTopStatusBar() {
    //获取小程序胶囊按钮布局
    if (uni.getMenuButtonBoundingClientRect) {
        let menuButtonBoundingClientRect = uni.getMenuButtonBoundingClientRect();
        return menuButtonBoundingClientRect.top - getStatusBarHeight();
    } else {
        return 0;
    }
};
//获取小程序胶囊按钮高度
export function getMenuButtonBoundingClientRectHeight() {
    //获取小程序胶囊按钮布局
    if (uni.getMenuButtonBoundingClientRect) {
        let menuButtonBoundingClientRect = uni.getMenuButtonBoundingClientRect();
        return menuButtonBoundingClientRect.height;
    } else {
        return 40;
    }
};
//获取头部高度
export function getHeadHeight() {
    return getMenuButtonBoundingClientRectMarginTop() + getMenuButtonBoundingClientRectHeight();
};